package www.yingdi365.com.listener;

import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;


/**
 * des： editview换行
 * author： ZhangJieBo
 * date： 2017/7/6 0006 下午 3:01
 */
public class HuanHangWatcher implements TextWatcher {
    private EditText mEditText;
    private int length;

    public HuanHangWatcher(EditText mEditText,int length) {
        this.mEditText = mEditText;
        this.length = length;
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {

    }

    @Override
    public void afterTextChanged(Editable s) {
        if (s.length() >= length) {
            mEditText.requestFocus();
        }
    }
}